Skip to content

Fix reproducibility issues #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6898603
Put back Unreleased in CHANGELOG.md.
prj- Apr 19, 2021
51786a0
correct pb in SortArray::hash() => reading of some mesh3 very very lo…
frederichecht Apr 22, 2021
616a6d3
correct some test
frederichecht Apr 23, 2021
db26bb3
MatComposite in MatNest.
prj- Apr 25, 2021
a272d87
Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources …
frederichecht Apr 26, 2021
96217ff
correct CheckAll and correct problem cast of P1S in P1, finite element.
frederichecht Apr 26, 2021
a8d1b91
correct MUMPS (mpi) missing clean distributed matrix (master<0)
frederichecht Apr 28, 2021
23600e0
correct assert in GenericElement & set if d !m dHat
frederichecht Apr 28, 2021
dd5ce20
Overloading the modulo operator for doubles (#174)
m-schindler Apr 29, 2021
3d42425
Leaks in block matrices.
prj- Apr 29, 2021
b5ea77f
Deprecates SLEPc and SLEPc-complex plugins.
prj- May 1, 2021
3469394
Compilation failure...
prj- May 1, 2021
88551ea
Mmg compilation without MPI wrappers
prj- May 15, 2021
bc66907
correct examples/potential.edp example wrong time step
frederichecht May 20, 2021
428cc20
rebuild AutoGeneratedFile.tar.gz
frederichecht May 21, 2021
277fb46
KSPSetOptionsPrefix() at the proper place.
prj- May 23, 2021
ae8c52d
No need for MatGetOperation().
prj- May 28, 2021
90f6158
Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources …
frederichecht May 28, 2021
7bc7678
other directory no longer there
bkmgit Jun 4, 2021
97bc5df
fix typo
bkmgit Jun 5, 2021
1a95372
Merge branch 'develop' of https://github.com/FreeFem/FreeFem-sources …
frederichecht Jun 9, 2021
597be2c
- add missing code on Line / surface fespace
frederichecht Jun 15, 2021
f40aa3a
correct bug in oriantation of meshL due to typo
frederichecht Jun 15, 2021
54014ac
PETSc 3.15.1
prj- Jun 18, 2021
cf686b6
Other MCS mirror.
prj- Jun 19, 2021
d5a3b65
MUMPS solves with multiple rhs
phtournier Jun 22, 2021
e44a074
saddle point solver + elasticity example
phtournier Jun 22, 2021
0aa6579
ridgeangle named parameter in ExtractMeshL in msh3 plugin
frederichecht Jun 29, 2021
bad5237
correct the new verson of RdHat and the construction (small bug in co…
frederichecht Jun 29, 2021
2fee7ff
try to clean type of integral for for the fure
frederichecht Jul 2, 2021
becddec
cite paper in DD saddle point example
phtournier Jul 6, 2021
4c07bfb
Fixes #183.
prj- Jul 6, 2021
8ea5cc2
Reverts 3d42425.
prj- Jul 7, 2021
80df4f1
Fixes for single-precision PetscScalar.
prj- Jul 12, 2021
c2ccfe9
Missing assert if no decomposition
prj- Jul 20, 2021
7cd3bd6
No PCCompositeGetPC with a single Schur Pmat.
prj- Jul 26, 2021
bb17cca
Apply reproductibility patch from debian package.
mzf-guest Jul 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 3rdparty/ff-petsc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ all-local:
@echo " make petsc-slepc "

DIRPKG=../pkg
VERSION=3.15.0
VERSION_SLEPC=3.014.2
VERSION=3.15.1
VERSION_SLEPC=3.15.1
PACKAGE=../pkg/petsc-$(VERSION).tar.gz
SRCDIR=petsc-$(VERSION)
MPI_DIR:=$(shell dirname $(MPI_INC_DIR))
Expand Down Expand Up @@ -302,7 +302,7 @@ endif
$(SRCDIR)/tag-tar:$(PACKAGE)
-tar xzf $(PACKAGE)
ifeq ($(WIN32DLLTARGET),)
cd petsc-$(VERSION) && patch -p1 < ../petsc-metis.patch && cd -
cd petsc-$(VERSION) && patch -p1 < ../petsc-cmake-seq.patch && cd -
endif
cd petsc-$(VERSION) && patch -p1 < ../petsc-suitesparse.patch && cd -
touch $@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,20 @@ index 136526da05..2d1c4d3271 100644
return args

def configureLibrary(self):
diff --git a/config/BuildSystem/config/packages/mmg.py b/config/BuildSystem/config/packages/mmg.py
index 1cc9122f41..4affbce3b3 100644
--- a/config/BuildSystem/config/packages/mmg.py
+++ b/config/BuildSystem/config/packages/mmg.py
@@ -27,6 +27,12 @@ class Configure(config.package.CMakePackage):
args.append('-DUSE_ELAS=OFF')
args.append('-DUSE_VTK=OFF')
args.append('-DSCOTCH_DIR:STRING="'+self.ptscotch.directory+'"')
+ mpicc = self.framework.getMakeMacro('MPICC_SHOW')
+ mpicxx = self.framework.getMakeMacro('MPICXX_SHOW')
+ if mpicc and mpicxx:
+ args = self.rmArgsStartsWith(args,['-DCMAKE_CXX_COMPILER','-DCMAKE_C_COMPILER'])
+ args.append('-DCMAKE_C_COMPILER="'+mpicc.split(None, 1)[0]+'"')
+ args.append('-DCMAKE_CXX_COMPILER="'+mpicxx.split(None, 1)[0]+'"')
return args

def configureLibrary(self):
10 changes: 5 additions & 5 deletions 3rdparty/getall
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,21 @@ download('parmmg','https://github.com/MmgTools/ParMmg/archive/f78f4e3e1019137787
'https://github.com/MmgTools',
'parmmg.zip',
'9a76fef6be1ab66af3a813409a0388c9');
download('PETSc','https://www.mcs.anl.gov/petsc/mirror/release-snapshots/petsc-3.15.0.tar.gz',
download('PETSc','https://www.mcs.anl.gov/petsc/mirror/release-snapshots/petsc-3.15.1.tar.gz',
'https://www.mcs.anl.gov/petsc/mirror/release-snapshots/',
'petsc-3.15.0.tar.gz',
'32cdb2a2aed1be52059f6221a41d2b18');
'petsc-3.15.1.tar.gz',
'af0d1b5c5a01a5f35636773661a025dd');

download('htool','https://github.com/htool-ddm/htool/archive/e008e87bded5626d73fa7655487aee48268e2149.zip',
'https://github.com/htool-ddm/',
'htool.zip',
'7ee614df188cf501c03c5f27d1569b1c');


download('hpddm','https://codeload.github.com/hpddm/hpddm/zip/e58205623814f59bf2aec2e2bab8eafcfbd22466',
download('hpddm','https://codeload.github.com/hpddm/hpddm/zip/01bd3df5a5dcb657a257ee118af98ef15a78b816',
'https://codeload.github.com/hpddm',
'hpddm.zip',
'b7a4f9be6de2df302485c4689a6c8078');
'48dac6ddbcad86ba62a29d71e3460846');

download('bemtool','https://github.com/PierreMarchand20/BemTool/archive/d327ef63c5abe88b13197c433a019e0db10eb426.zip',
'https://github.com/PierreMarchand20/BemTool',
Expand Down
Binary file modified AutoGeneratedFile.tar.gz
Binary file not shown.
49 changes: 40 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,65 @@

# Changelog
All notable changes to this project will be documented in this file.
## [Unreleased]
### Added
- ridgeangle named parameter in ExtractMeshL in msh3 plugin
- DG formulation in 1d :
add integral of all border of element : `intallBE(ThL)` and unified the notation by adding
`intallBE(ThS)` , `intallBE(Th2)`, `intallBE(Th3)`

`nuVertex` of now the vertex number of element in intallBE0d integral
`BoundaryBE`, `InternalBE` to know if border element (BE) is on true boundary of not.
update `nElementonB` in case on no manifold data (value greater > 2) in meshL, MeshS case ..
add code to use jump, mean of test functuon on MeshL case. ( not in mesh3 ) to compute RHS.

- add getcwd() function in shell plugin to ghet the current working dir
- add nuVertex to get the vextex on element in some int?

### Changed
-

### Deprecated
- SLEPc and SLEPc-complex have been part of PETSc and PETSc-complex for multiple releases and are now deprecated

### Removed
-

### Fixed
- examples/potential.edp correct problem in times loops and BC
- tutorial/mortar-DN-4.edp correct problem of region number in meshL
- fixe problem in Curve mesh and intallBE , vertex number is wrong

### Security
-

## [4.9]
### Added
- add P3 lagrange finite element on meshS and meshS
- add P3 lagrange finite element on meshS and meshS
- add new plugin `meshtool`to add tool to compute the number of connected components of a all kind of mesh
(mesh,mesh3,meshS,meshL) with 2 kind of connected components ones on interior part of the mesh (default) ans
secondly on the closure of the mesh (see `examples/hpddm/bConnectedComponents.edp` )
add functions int[int] In=iminP1K(Th,u) or int[int] Ix=imaxP1K(Th,u) get the array min/max of value u[i]
where i is vertex number on each element k, so we have u[Im[k]] = min u[i]/ i in k;
where i is vertex number on each element k, so we have u[Im[k]] = min u[i]/ i in k;
- add in plugin `bfstream` to to read binary int (4 bytes) to read fortran file and try to pull tools to share the endiannes
in progress
- add gluemesh of array of MeshL and MeshS type
- interface to `PC_MG_GALERKIN_BOTH`
- Kronecker product of two sparse matrices `matrix C = kron(A, B)`
- add lot of finite element on Mesh3, MeshS, MeshL of Discontinous Galerling Element
in 3d : P1dc3d, P2dc3d, P3dc3d, P4dc3d , P0edge3d ,P0edgedc3d , P0face3d ,P0facedc3d , P0VF3d ,P0VFdc3d ,
on Surface : P1dcS, P2dcS, P3dcS, P4dcS , P0edgeS ,P0edgedcS , P0VFS ,P0VFdcS,
in 3d : P1dc3d, P2dc3d, P3dc3d, P4dc3d , P0edge3d ,P0edgedc3d , P0face3d ,P0facedc3d , P0VF3d ,P0VFdc3d ,
on Surface : P1dcS, P2dcS, P3dcS, P4dcS , P0edgeS ,P0edgedcS , P0VFS ,P0VFdcS,
on Curve : P1dcL, P2dcL, P3dcL, P4dcL , P0VFL ,P0VFdcL
remark; the associated generic name existe of P1dc, P2dc, P0edge, P0VF and all dc finite element corresponding to
no continuity across element.
- add code of intallfaces to do Discontinous Galerkin formulation in 3d (in test FH.)
no continuity across element.
- add code of intallfaces to do Discontinous Galerkin formulation in 3d (in test FH.)
### Changed
- Now the order to find MPI in configure is first if you have PETSC then take MPI from PETSc
otherwise use previous method
- on MeshL defined with buildmeshL now the default label are 2*k-1 (resp. 2*k) for the begin (resp. end) of curve
where k is the order of curve use in buildmeshL. So if you have one curve the labels are 1 and 2.
And new the element label are te region number not the label.
This element are not really test so be carfull.
This element are not really test so be carfull.
- PETSc 3.15.0

### Deprecated
Expand All @@ -59,9 +90,9 @@ All notable changes to this project will be documented in this file.
-

### Fixed
- bug in Find triangle contening point in 2d (border case),
- bug in Find triangle contening point in 2d (border case),
`int Mesh::DataFindBoundary::Find(R2 PP,R *l,int & outside) const`
the parameter l not correclty return due to local variable.
the parameter l not correclty return due to local variable.
- set CFLAGS=-Wno-implicit-function-declaration to complie with Apple clang version 12.0.0 (clang-1200.0.32.29)
to remove following error: implicit declaration of function
correct `3dCurve/basicGlue.edp`and add missing test
Expand Down
6 changes: 4 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ m4_define([TOOL_DISABLE_NO],
TOOL_PARAMETERS($1,$2,$3)
])

echo "# Build with FreeFEM with ./configure " `date` >$ff_where_lib_conf
BUILD_DATE="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"

echo "# Build with FreeFEM with ./configure $BUILD_DATE" >$ff_where_lib_conf
# To allow anonymous CVS version to contain a "./configure" and
# Makefiles

Expand Down Expand Up @@ -667,7 +669,7 @@ ff_prefix_dir="${prefix}/lib/ff++/$VERSION"
AC_MSG_CHECKING(prefix dir freefem++ )
AC_MSG_RESULT($ff_prefix_dir)

FF_DATE=`date`
FF_DATE="$BUILD_DATE"
AC_DEFINE_UNQUOTED(VersionFreeFemDate,"$FF_DATE",FreeFEM build date)
AC_DEFINE_UNQUOTED(FF_PREFIX_DIR,"${ff_prefix_dir}",FreeFem prefix dir)
AC_SUBST(ff_prefix_dir,$ff_prefix_dir)
Expand Down
2 changes: 1 addition & 1 deletion etc/config/m4/acmpi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ fi
test -n "$MPICC" && ff_mpicshow=`$MPICC -show` 2>/dev/null
test -n "$MPIFC" && ff_mpifcshow=`$MPIFC -show` 2>/dev/null
if test "$with_mpilibs" = no -o -z "$with_mpilibs" ; then
[ff_MPI_INCLUDE=`echo $ff_mpishow|tr ' ' '\n'| grep -E '^[-/][^WLlOgpf]|^-Wp,'|tr '\n' ' '`]
[ff_MPI_INCLUDE=`echo $ff_mpishow|tr ' ' '\n' | sed '1 d'| grep -E '^[-/][^WLlOgpf]|^-Wp,'|tr '\n' ' '`]
ff_MPI_LIB_DIRS=""
[ff_MPI_LIB=`echo $ff_mpishow|tr ' ' '\n'| grep -E '^-[Llp]|^-Wl,'|tr '\n' ' '`]
[ff_MPI_LIBC=`echo $ff_mpicshow|tr ' ' '\n'| grep -E '^-[Llp]|^-Wl,'|tr '\n' ' '`]
Expand Down
2 changes: 1 addition & 1 deletion etc/jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ make -j4 install

```

Jenkins projets are [here](https://ci.inria.fr/freefem-dev/) and [here](https://ci.inria.fr/freefem-dev-2/)
Jenkins projects are [here](https://ci.inria.fr/freefem-dev/) and [here](https://ci.inria.fr/freefem-dev-2/)


# Job 1
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ EXTRA_DIST = *.edp \

all.edp: Makefile
(echo "NoGraphicWindow=true;NoUseOfWait=true;int verbosityy=verbosity;int MEM1234=storageused();"; \
for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
echo "verbosity=verbosityy;searchMethod=0;" ; \
echo \{ include \"$$i\"\;\}\; ;\
Expand Down
2 changes: 1 addition & 1 deletion examples/3dCurve/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ EXTRA_DIST = *.edp all.edp

all.edp: Makefile
(echo "NoGraphicWindow=true;NoUseOfWait=true;int verbosityy=verbosity;int MEM1234=storageused();"; \
for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
echo "verbosity=verbosityy;searchMethod=0;" ; \
echo \{ include \"$$i\"\;\}\; ;\
Expand Down
4 changes: 4 additions & 0 deletions examples/3dCurve/periodicL.edp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ load "msh3"

meshL Th=segment(10,[x*pi*2]);
fespace Vh(Th,P1,periodic=[[1],[2]]);
meshL ThVh = Vh.Th; // check code ..
func u1e =(sin(x+1));
Vh u,v,uh=u1e;

meshL Thu = u.Th; // check code ..
u.n; // check code ..
func f1= 1*u1e;
macro grad3(u) [dx(u),dy(u),dz(u)]//
solve PP2(u,v) = int1d(Th)(grad3(u)'*grad3(v)+1e-6*u*v) - int1d(Th)(f1*v) ;
Expand Down
2 changes: 1 addition & 1 deletion examples/3dSurf/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ EXTRA_DIST = *.edp all.edp

all.edp: Makefile
(echo "NoGraphicWindow=true;NoUseOfWait=true;int verbosityy=verbosity;int MEM1234=storageused();"; \
for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
echo "verbosity=verbosityy;searchMethod=0;" ; \
echo \{ include \"$$i\"\;\}\; ;\
Expand Down
1 change: 0 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ADD_SUBDIRECTORY(examples)
ADD_SUBDIRECTORY(eigen)
#ADD_SUBDIRECTORY(plugin)
ADD_SUBDIRECTORY(mpi)
ADD_SUBDIRECTORY(other)
ADD_SUBDIRECTORY(tutorial)
ADD_SUBDIRECTORY(ffddm)

4 changes: 2 additions & 2 deletions examples/CheckAll
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rm CheckAll-out
for i in */.; do
cd $i;
case $i in
*mpi/.|*hpddm/.) ;;
*mpi/.|*hpddm/.|*ffddm/) ;;
*) echo ---- $i ---
../CheckAllEdp "$ff -nw" *.edp | tee -a ../CheckAll-out ;;
esac;
Expand All @@ -19,7 +19,7 @@ if [ -n "$ffmpi" ] ; then
for i in */.; do
cd $i;
case $i in
*mpi/.|*hpddm/.)
*mpi/.|*hpddm/.|*ffddm/.)
echo MPI ---- $i ---
../CheckAllEdp "$ffmpi -np 4" *.edp | tee -a ../CheckAll-out;;
esac;
Expand Down
4 changes: 2 additions & 2 deletions examples/eigen/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ EXTRA_DIST = *.edp all.edp

all.edp:
(echo "NoUseOfWait=true;int verbosityy=verbosity;"; \
for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
echo "verbosity=verbosityy;" ; \
echo \{ include \"$$i\"\;\}\; ;\
Expand All @@ -66,4 +66,4 @@ all.edp:

freefem++.pref:Makefile
echo includepath = \"../../idp/\" > freefem++.pref
echo loadpath = \"../../plugin/seq/\" >> freefem++.pref
echo loadpath = \"../../plugin/seq/\" >> freefem++.pref
4 changes: 2 additions & 2 deletions examples/eigen/condition-number.edp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mesh Th=square(100,100,[x*pi,y*pi]);
mesh Th=square(50,50,[x*pi,y*pi]);
macro grad(u) [dx(u),dy(u)]//
int[int] L=[1,2,3,4];
varf vlapWithBC(u,v)= int2d(Th)(grad(u)'*grad(v))+ on(L,u=0);
Expand All @@ -8,7 +8,7 @@ fespace Vh(Th,P1);
Vh u,v;
u=1;
matrix Id=u[]; // vMass(Vh,Vh,solver=CG) ;
set(Id,solver=CG);
set(Id,solver=CG,verb=0);
matrix Abc= vlapWithBC(Vh,Vh,solver=sparsesolver);
matrix Ancl= vlapWithoutBC(Vh,Vh,solver=CG);
real[int] aevmin(2),aevmax(2);
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ EXTRA_DIST = *.edp all.edp regtests.edp regtests.m4 ref.edp

all.edp:
(echo "NoUseOfWait=true;int verbosityy=verbosity;"; \
for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$'` ; do \
for i in *`ls *.edp|grep -v -E '^(all|regtests|makeref|ref)\.edp$$' | LC_ALL=C sort` ; do \
echo ' cout << "--------- file : '$$i' --------------------------------------------------------" << endl;' ;\
echo "verbosity=verbosityy;" ; \
echo \{ include \"$$i\"\;\}\; ;\
Expand Down
34 changes: 18 additions & 16 deletions examples/examples/potential.edp
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,59 @@
/* You should have received a copy of the GNU Lesser General Public License */
/* along with FreeFEM. If not, see <http://www.gnu.org/licenses/>. */
/****************************************************************************/

// Corrected by F. Hecht may 2021
// Parameters
real S = 99;

border C(t=0, 2*pi){x=3*cos(t); y=3*sin(t);}
border Splus(t=0, 1){x=t; y=0.17735*sqrt(t) - 0.075597*t - 0.212836*(t^2) + 0.17363*(t^3) - 0.06254*(t^4); label=S;}
border Sminus(t=1, 0){x=t; y=-(0.17735*sqrt(t) - 0.075597*t - 0.212836*(t^2) + 0.17363*(t^3) - 0.06254*(t^4)); label=S;}
border C(t=0, 2*pi){x=3*cos(t); y=3*sin(t);} // Label 1,2
border Splus(t=0, 1){x=t-0.5; y=0.17735*sqrt(t) - 0.075597*t - 0.212836*(t^2) + 0.17363*(t^3) - 0.06254*(t^4); label=S;}
border Sminus(t=1, 0){x=t-0.5; y=-(0.17735*sqrt(t) - 0.075597*t - 0.212836*(t^2) + 0.17363*(t^3) - 0.06254*(t^4)); label=S;}
mesh Th = buildmesh(C(50) + Splus(70) + Sminus(70));

// Fespace
fespace Vh(Th, P2);
Vh psi, w;

real cost = cos(5.*pi/180.), sint=sin(5.*pi/180.);// incidence 5 degres
// Problem
solve potential(psi, w)
= int2d(Th)(dx(psi)*dx(w)+dy(psi)*dy(w))
+ on(C, psi = y)
+ on(C, psi = cost*y-sint*x)
+ on(S, psi=0);

// Plot
plot(psi, wait=1);

/// Thermic
// Parameters
real dt = 0.05, nbT = 50;
real dt = 0.005, nbT = 50;

// Mesh
border D(t=0, 2){x=1+t; y=0;}
border D(t=0, 2.){x=0.5+t*cost; y=+t*sint;}
mesh Sh = buildmesh(C(25) + Splus(-90) + Sminus(-90) + D(200));
int steel = Sh(0.5, 0).region, air = Sh(-1, 0).region;

// Change label to put BC on In flow
// Fespace
fespace Wh(Sh, P1);
Wh v, vv;
Wh vv;

fespace W0(Sh, P0);
W0 k = 0.01*(region == air) + 0.1*(region == steel);
W0 u1 = dy(psi)*(region == air), u2 = -dx(psi)*(region == air);
Wh vold = 120*(region == steel);

Wh v = 120*(region == steel), vold;
// pul label 10 on inflow boundary to inforce the temperature.
Sh = change(Sh,flabel = (label == C && [u1,u2]'*N<0) ? 10 : label);
int i;
problem thermic(v, vv, init=i, solver=LU)
= int2d(Sh)(
v*vv/dt + k*(dx(v)*dx(vv) + dy(v)*dy(vv))
+ 10*(u1*dx(v) + u2*dy(v))*vv
)
- int2d(Sh)(vold*vv/dt);
- int2d(Sh)(vold*vv/dt)
+ on(10, v= 0);


for(i = 0; i < nbT; i++) {
v = vold;
vold[]= v[];
thermic;
plot(v);
}
plot(v, wait=1);
plot(v, wait=1,fill=1,value=1);
Loading