[freefempp] 01/05: Imported Upstream version 3.37
Dimitrios Eftaxiopoulos
eftaxiop-guest at moszumanska.debian.org
Sun May 17 10:42:54 UTC 2015
This is an automated email from the git hooks/post-receive script.
eftaxiop-guest pushed a commit to branch master
in repository freefempp.
commit f9253eefa84b292478f1b0b4566c99375dc33701
Author: Dimitrios Eftaxiopoulos <eftaxi12 at otenet.gr>
Date: Sat May 16 21:38:25 2015 +0300
Imported Upstream version 3.37
---
HISTORY | 122 ++++++++++++++++++++++++++++++++++-
INNOVATION | 14 +++-
configure | 20 +++---
configure.ac | 2 +-
download/getall | 2 +-
examples++-load/ClosePoints.cpp | 88 ++++++++++++++++++++++++++
examples++-load/ClosePoints.edp | 57 +++++++++++++++++
examples++-load/Makefile.am | 7 +-
examples++-load/Makefile.in | 14 +++-
examples++-load/aniso.cpp | 137 ++++++++++++++++++++++++++++++++++++++++
examples++-mpi/PETSc.hpp | 3 +-
src/Graphics/getprog-unix.hpp | 2 +-
src/bamglib/Mesh2.cpp | 11 ++--
src/bamglib/Mesh2.h | 6 +-
src/bin-win32/launchff++.cpp | 10 +--
src/femlib/MatriceCreuse.hpp | 2 +-
src/femlib/RefCounter.hpp | 4 +-
src/fflib/AFunction.hpp | 13 ++--
src/fflib/AFunction2.cpp | 32 ++++++----
src/fflib/AFunction_ext.hpp | 10 +--
src/fflib/CodeAlloc.hpp | 2 +
src/fflib/ffstack.hpp | 10 ++-
src/fflib/global.cpp | 6 ++
src/fflib/problem.cpp | 62 ++++++++++--------
src/fflib/strversionnumber.cpp | 4 +-
src/lglib/lg.tab.cpp | 2 +-
src/lglib/lg.ypp | 2 +-
27 files changed, 549 insertions(+), 95 deletions(-)
diff --git a/HISTORY b/HISTORY
index 9636177..8300a11 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,126 @@
-@ changeset: 3296:85dbc875ef1a
+@ changeset: 3320:e8ea8202d9af
| tag: tip
| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Thu Apr 30 17:55:18 2015 +0200
+| summary: version 3.37
+|
+o changeset: 3319:8657e0526391
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Thu Apr 30 17:44:30 2015 +0200
+| summary: remove debut cout
+|
+o changeset: 3318:7113fd6d9cba
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Thu Apr 30 16:27:53 2015 +0200
+| summary: add missing plugin aniso
+|
+o changeset: 3317:09260ac5f6a3
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Thu Apr 30 16:05:14 2015 +0200
+| summary: add -wait in case of no parameter in launchff++ under win32
+|
+o changeset: 3316:a8743bcf97cd
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Thu Apr 30 16:03:11 2015 +0200
+| summary: correct wait under windows by default only withvia launchff++
+|
+o changeset: 3315:faaa3bc0050c
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Thu Apr 30 14:44:10 2015 +0200
+| summary: pass to version 3.37
+|
+o changeset: 3314:7c816b2243e8
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Wed Apr 29 23:35:08 2015 +0200
+| summary: correct be mistake in DG formulation with jump/mean on test function
+|
+o changeset: 3313:dc3c17483f8e
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Wed Apr 29 20:59:54 2015 +0200
+| summary: correct bug in debugshack
+|
+o changeset: 3312:13fbf0663dff
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Wed Apr 22 12:26:20 2015 +0200
+| summary: Pierre Jolivet correction.
+|
+o changeset: 3311:67e1fedbe5bf
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 17 21:57:54 2015 +0200
+| summary: add ClosePoints tools et exemples
+|
+o changeset: 3310:16f2b8a6a9fa
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 17 19:29:57 2015 +0200
+| summary: rebuild AutoGeneratedFile.tar.gz
+|
+o changeset: 3309:46581ff2135d
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 17 19:29:09 2015 +0200
+| summary: correct for new apple compiler pb on null ref.
+|
+o changeset: 3308:4fc51ad7ea1a
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 17 18:13:34 2015 +0200
+| summary: try to remove null ref.
+|
+o changeset: 3307:c06b5ae10a38
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 17 17:16:54 2015 +0200
+| summary: correct problem due to null ref
+|
+o changeset: 3306:cb40b21b4fbe
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 17 16:33:39 2015 +0200
+| summary: contine remoev ref on null
+|
+o changeset: 3305:358680b9a4d1
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 17 16:03:10 2015 +0200
+| summary: replace ref to point in bamg
+|
+o changeset: 3304:90a668f13fc7
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 17 15:06:27 2015 +0200
+| summary: correct pb of optimisation of null ref in bamg
+|
+o changeset: 3303:bdc269a66962
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 17 12:02:40 2015 +0200
+| summary: correct pb in small allocation (in test)
+|
+o changeset: 3302:5e03e66f18b1
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 10 11:14:19 2015 +0200
+| summary: coorect type
+|
+o changeset: 3301:38b9115787ef
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Fri Apr 10 10:53:07 2015 +0200
+| summary: add BADCERT in hpddm
+|
+o changeset: 3300:3e2860ea680d
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Thu Apr 09 18:02:14 2015 +0200
+| summary: add new exmaple and rebuild AutoGeneratedFile.tar.gz
+|
+o changeset: 3299:280ddd056f47
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Thu Apr 09 17:57:27 2015 +0200
+| summary: add trick to remove round off error in computation of the partition
+|
+o changeset: 3298:ba77ec033847
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Thu Apr 09 14:28:08 2015 +0200
+| summary: correct problem of check of negatif volunme in case of no vbolume
+|
+o changeset: 3297:77ef94e25fbb
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
+| date: Thu Apr 09 14:22:32 2015 +0200
+| summary: add tools to build mesh a set on interal point add points=P
+|
+o changeset: 3296:85dbc875ef1a
+| user: Frederic Hecht <frederic.hecht at upmc.fr>
| date: Sun Apr 05 10:07:11 2015 +0200
| summary: corect pb in Mesh::Find is case of brute forces.
|
diff --git a/INNOVATION b/INNOVATION
index b140eb2..1780f7b 100644
--- a/INNOVATION
+++ b/INNOVATION
@@ -1,4 +1,16 @@
- - correct configire and makefile for windows compilation process
+version 30 april 2015 (3319:8657e0526391)
+ - correct freefem++ launch in windows (remove wait when launch vai freefem++)
+ add wait in case of launch throught launchff++.exe
+ - in DG linear form with jump or mean in test fonction was wrong
+ like varf a(u,v)=intalledges(Th)(jump(v)*u) ;
+
+ - correct problem of try/catch in freefem++ func
+version 3.36-2
+ - correct problem some null ref with compile Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn) xcode 6.3
+ some warning exist but all test pass.
+ - correct problem of cleanning tmp memory for small array
+
+ - correct configure and makefile for windows compilation process
version 3.36
- add tools to remove (now build in)
utility.dylib removeDOF.dylib symmetrizeCSR.dylib
diff --git a/configure b/configure
index 7eb8b6b..d28d0b0 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for FreeFem++ 3.36-1.
+# Generated by GNU Autoconf 2.69 for FreeFem++ 3.37.
#
# Report bugs to <hecht at ann.jussieu.fr>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='FreeFem++'
PACKAGE_TARNAME='freefem++'
-PACKAGE_VERSION='3.36-1'
-PACKAGE_STRING='FreeFem++ 3.36-1'
+PACKAGE_VERSION='3.37'
+PACKAGE_STRING='FreeFem++ 3.37'
PACKAGE_BUGREPORT='hecht at ann.jussieu.fr'
PACKAGE_URL=''
@@ -1591,7 +1591,7 @@ 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 FreeFem++ 3.36-1 to adapt to many kinds of systems.
+\`configure' configures FreeFem++ 3.37 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1661,7 +1661,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of FreeFem++ 3.36-1:";;
+ short | recursive ) echo "Configuration of FreeFem++ 3.37:";;
esac
cat <<\_ACEOF
@@ -1949,7 +1949,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-FreeFem++ configure 3.36-1
+FreeFem++ configure 3.37
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2803,7 +2803,7 @@ 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 FreeFem++ $as_me 3.36-1, which was
+It was created by FreeFem++ $as_me 3.37, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3677,7 +3677,7 @@ fi
# Define the identity of the package.
PACKAGE='freefem++'
- VERSION='3.36-1'
+ VERSION='3.37'
cat >>confdefs.h <<_ACEOF
@@ -19834,7 +19834,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by FreeFem++ $as_me 3.36-1, which was
+This file was extended by FreeFem++ $as_me 3.37, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19900,7 +19900,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-FreeFem++ config.status 3.36-1
+FreeFem++ config.status 3.37
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index c4ca3e1..bfb7e4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@
# number in debian/changelog.
-AC_INIT(FreeFem++,3.36-1,hecht at ann.jussieu.fr,freefem++)
+AC_INIT(FreeFem++,3.37,hecht at ann.jussieu.fr,freefem++)
dnl : ${CFLAGS=""}
dnl : ${CXXFLAGS=""}
dnl : ${FCFLAGS=""}
diff --git a/download/getall b/download/getall
index 492c289..1f224e3 100755
--- a/download/getall
+++ b/download/getall
@@ -161,7 +161,7 @@ download('TetGen','http://wias-berlin.de/software/tetgen/files/tetgen1.4.3.tar.g
download('PETSc','http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.5.2.tar.gz',
'http://ftp.mcs.anl.gov/pub/petsc/release-snapshots','petsc-lite-3.5.2.tar.gz','d707336a98d7cb31d843804d020edc94');
download('hpddm','https://github.com/hpddm/hpddm/archive/master.zip',
- 'https://github.com/hpddm','hpddm.zip','none');
+ 'https://github.com/hpddm','hpddm.zip','none','BAD_CERT');
# run all downloads concurrently
diff --git a/examples++-load/ClosePoints.cpp b/examples++-load/ClosePoints.cpp
new file mode 100644
index 0000000..a88ea52
--- /dev/null
+++ b/examples++-load/ClosePoints.cpp
@@ -0,0 +1,88 @@
+#include <ff++.hpp>
+#include <AFunction_ext.hpp>
+using namespace Fem2D;
+
+
+double dist2(int n,double *p,double *q)
+{
+ double s=0;
+ for(int i=0; i<n;++n)
+ s += (q[i]-p[i])*(q[i]-p[i]);
+ return s;
+}
+long Hcode(int n,double eps,double *p,double *p0);
+
+KN<long>* CloseTo(Stack stack,double const & eps,KNM<double> * const & p,KNM<double> * const & q)
+{
+
+ long n=q->N();
+ KN<long>* pr=new KN<long>(q->N());
+ MeshPoint &mp= *MeshPointStack(stack); // the struct to get x,y, normal , value
+
+ //HashTable<long,int> table(n);
+ double *p0=&(*p)(0,0);
+
+
+ return Add2StackOfPtr2FreeRC(stack,pr);
+}
+KN<long>* CloseTo(Stack stack,double const & eps,pmesh const & pTh,KNM<double> * const & pq)
+{
+ ffassert(pTh && pq);
+ const Mesh & Th=*pTh;
+ const KNM<double> Q=*pq;
+ int np=Q.N();
+ assert(Q.M()>=2);
+ KN<long>* pr=new KN<long>(np);
+ KN<int> b(Th.nv);
+ b=0;
+ for (int i=0;i<Th.nv;i++)
+ if(Th(i).lab!=0) b[i]=1;
+ for (int i=0;i<Th.neb;i++)
+ {
+ b[ Th(Th.bedges[i][0])]=1;
+ b[ Th(Th.bedges[i][1])]=1;
+ }
+
+
+ *pr=-1L;
+ R2 Pmin,Pmax;
+ Th.BoundingBox(Pmin,Pmax);
+ int nv=b.sum();
+ cout << " Th.nv " <<Th.nv << " " << nv << "/ " << Pmin << " "<< Pmax <<endl;
+ FQuadTree * quadtree = new FQuadTree(pTh,Pmin,Pmax,nv); // put all the old vertices in the quadtree
+ // copy of the old vertices
+ for (int i=0;i<Th.nv;i++)
+ {
+ if(b[i])
+ { cout << i << " " << Th.vertices[i] << endl;
+ quadtree->Add(Th.vertices[i]);
+ }
+
+ }
+ cout << " After quadterr" << endl;
+ for (int j=0;j<np; ++j)
+ {
+ R2 P(Q(j,0),Q(j,1));
+
+ Vertex * pV=quadtree->ToClose(P,eps);
+ if(pV)
+ {
+ pV=quadtree->NearestVertex(P);
+ long k= Th(pV);
+ cout << j << " " << k << " " << P << " " << pV <<endl;
+
+ (*pr)[j]=k;
+ }
+ }
+ delete quadtree;
+
+ return Add2StackOfPtr2FreeRC(stack,pr);
+}
+
+
+void init(){
+ // Global.Add("ClosePoints","(",new OneOperator3s_<KN<long>*,double,KNM<double> * ,KNM<double> * >(CloseTo));
+ Global.Add("ClosePoints","(",new OneOperator3s_<KN<long>*,double,pmesh,KNM<double> * >(CloseTo));
+}
+
+LOADFUNC(init);
diff --git a/examples++-load/ClosePoints.edp b/examples++-load/ClosePoints.edp
new file mode 100644
index 0000000..6bcb294
--- /dev/null
+++ b/examples++-load/ClosePoints.edp
@@ -0,0 +1,57 @@
+// FFCS: for regression tests
+load "ClosePoints"
+real regtest;
+{
+ // example of mesh with a given set of internal point (P)
+ // P(i,0) x,
+ // P(i,1) y,
+ // P(i,2) = mesh density close to x,y not mandatory ..
+ verbosity=1;
+
+ real[int,int] P(100,3);
+ real[int,int] Q(100,2);
+ for(int i=0; i<P.n; ++i)
+ {
+ P(i,0) = 0.5+0.1*cos(i*0.02*pi);
+ P(i,1) = 0.5+0.1*sin(i*0.02*pi);
+ Q(i,0)=P(i,0)+i*0.001;
+ Q(i,1)=P(i,1);
+
+ P(i,2) = 0.05*0.02*2*pi;// mesh size auron point..
+ }
+// multy border syntax version 3.30 avril 2014 ...
+ real[int] xx=[0,1,1,0],
+ yy=[0,0,1,1];
+ // radius, centre of the 4 circles ..
+ real[int] RC=[ 0.1, 0.05, 0.05, 0.1],
+ XC= [0.2,0.8,0.2,0.8],
+ YC= [0.2,0.8,0.8,0.2];
+ int[int] NC=[-10,-11,-12,13]; //list number of $\pm$ segments
+ // of the 4 circles borders
+
+ border bb(t=0,1;i)
+ {
+ // i is the the index variable of the multi border loop
+ int ii = (i+1)%4; real t1 = 1-t;
+ x = xx[i]*t1 + xx[ii]*t;
+ y = yy[i]*t1 + yy[ii]*t;
+ label = 0; ;
+ }
+
+ border cc(t=0,2*pi;i)
+ {
+ x = RC[i]*cos(t)+XC[i];
+ y = RC[i]*sin(t)+YC[i];
+ label = i+1;
+ }
+ int[int] nn=[4,4,5,7];// 4 border , with 4,4,5,7 segment respectively .
+ plot(bb(nn),cc(NC),wait=1);
+ mesh th= buildmesh(bb(nn)+cc(NC), points=P,nbvx=100000) ;
+ plot(th,wait=1,ps="multy-border+internal.eps");
+ regtest = th.area;
+ real eps= 0.01;
+ //dumptable(cout);
+ int[int] ccc= ClosePoints(eps,th,Q);
+ cout << ccc << endl;
+
+}
diff --git a/examples++-load/Makefile.am b/examples++-load/Makefile.am
index 1191bde..5510bb5 100644
--- a/examples++-load/Makefile.am
+++ b/examples++-load/Makefile.am
@@ -1,5 +1,5 @@
all-local: @LOAD_COMPILE@
-TESTS=APk-AdaptEpsDeltaPk.edp APk-ExplicitPkTest.edp APk-FreeFemQA.edp APk-MetricPk.edp IPOTest.edp IpOptMinSurf.edp IpoptLap.edp IpoptMinSurfVol.edp IpoptVI.edp IpoptVI2.edp LapDG3.edp LapDG4.edp LapLNewSolver.edp LapMUMPS_seq.edp LapNewSolver.edp LapUmfpack64.edp LaplaceP3.edp LaplaceP4.edp LaplaceRT1.edp Leman-mesh.edp MetricKuate.edp NSP2BRP0.edp PARDISO.edp SuperLU.edp VarIneq2.edp bilapMorley.edp bmo.edp buildlayermesh.edp checkglumeshcube.edp cmaes-VarIneq.edp cmaes-oven.edp conv [...]
+TESTS=APk-AdaptEpsDeltaPk.edp APk-ExplicitPkTest.edp APk-FreeFemQA.edp APk-MetricPk.edp IPOTest.edp IpOptMinSurf.edp IpoptLap.edp IpoptMinSurfVol.edp IpoptVI.edp IpoptVI2.edp LapDG3.edp LapDG4.edp LapLNewSolver.edp LapMUMPS_seq.edp LapNewSolver.edp LapUmfpack64.edp LaplaceP3.edp LaplaceP4.edp LaplaceRT1.edp Leman-mesh.edp MetricKuate.edp NSP2BRP0.edp PARDISO.edp SuperLU.edp VarIneq2.edp bilapMorley.edp bmo.edp buildlayermesh.edp checkglumeshcube.edp cmaes-VarIneq.edp cmaes-oven.edp conv [...]
# all test can fail must but clean ???? FH...
XFAIL_TESTS=$(TESTS)
@@ -50,7 +50,8 @@ ff-get-dep.in ff-get-dep.awk ff-pkg-download.in load.link.in include.tar.gz \
dmatrix.hpp PARDISO.cpp \
ch.pts BEC.cpp bfstream.cpp iohdf5.cpp \
iohd5-beam-2d.edp iohd5-beam-3d.edp ff-AiryBiry.cpp \
- exactpartition.cpp exactpartition.edp
+ exactpartition.cpp exactpartition.edp \
+ ClosePoints.cpp aniso.cpp
LIST_COMPILE=myfunction.$(DYLIB_SUFFIX) BernadiRaugel.$(DYLIB_SUFFIX) \
Morley.$(DYLIB_SUFFIX) funcTemplate.$(DYLIB_SUFFIX) addNewType.$(DYLIB_SUFFIX) \
@@ -72,7 +73,7 @@ LIST_COMPILE=myfunction.$(DYLIB_SUFFIX) BernadiRaugel.$(DYLIB_SUFFIX) \
MetricPk.$(DYLIB_SUFFIX) FreeFemQA.$(DYLIB_SUFFIX) shell.$(DYLIB_SUFFIX) \
@TOOL_DYLIB_pipe@ symmetrizeCSR.$(DYLIB_SUFFIX) BEC.$(DYLIB_SUFFIX) \
bfstream.$(DYLIB_SUFFIX) @TOOL_DYLIB_iohdf5@ ff-AiryBiry.$(DYLIB_SUFFIX) \
- exactpartition.$(DYLIB_SUFFIX)
+ exactpartition.$(DYLIB_SUFFIX) ClosePoints.$(DYLIB_SUFFIX) aniso.$(DYLIB_SUFFIX)
# FFCS - some libraries are skipped because the corresponding tool is deactivated.
diff --git a/examples++-load/Makefile.in b/examples++-load/Makefile.in
index 875c1f8..d3d6e0f 100644
--- a/examples++-load/Makefile.in
+++ b/examples++-load/Makefile.in
@@ -629,7 +629,7 @@ TESTS = APk-AdaptEpsDeltaPk.edp APk-ExplicitPkTest.edp \
testFE-P4.edp testFE-P4dc.edp testFE-PkEdge.edp testFE.edp \
testFEMorley.edp tetgencube.edp tetgenholeregion_rugby.edp \
thresholdings.edp ttestio.edp bfstream.edp \
- bilapP3-hct-like.edp
+ bilapP3-hct-like.edp ClosePoints.edp
# all test can fail must but clean ???? FH...
XFAIL_TESTS = $(TESTS)
LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-ff
@@ -678,7 +678,8 @@ ff-get-dep.in ff-get-dep.awk ff-pkg-download.in load.link.in include.tar.gz \
dmatrix.hpp PARDISO.cpp \
ch.pts BEC.cpp bfstream.cpp iohdf5.cpp \
iohd5-beam-2d.edp iohd5-beam-3d.edp ff-AiryBiry.cpp \
- exactpartition.cpp exactpartition.edp
+ exactpartition.cpp exactpartition.edp \
+ ClosePoints.cpp aniso.cpp
LIST_COMPILE = myfunction.$(DYLIB_SUFFIX) BernadiRaugel.$(DYLIB_SUFFIX) \
Morley.$(DYLIB_SUFFIX) funcTemplate.$(DYLIB_SUFFIX) addNewType.$(DYLIB_SUFFIX) \
@@ -700,7 +701,7 @@ LIST_COMPILE = myfunction.$(DYLIB_SUFFIX) BernadiRaugel.$(DYLIB_SUFFIX) \
MetricPk.$(DYLIB_SUFFIX) FreeFemQA.$(DYLIB_SUFFIX) shell.$(DYLIB_SUFFIX) \
@TOOL_DYLIB_pipe@ symmetrizeCSR.$(DYLIB_SUFFIX) BEC.$(DYLIB_SUFFIX) \
bfstream.$(DYLIB_SUFFIX) @TOOL_DYLIB_iohdf5@ ff-AiryBiry.$(DYLIB_SUFFIX) \
- exactpartition.$(DYLIB_SUFFIX)
+ exactpartition.$(DYLIB_SUFFIX) ClosePoints.$(DYLIB_SUFFIX) aniso.$(DYLIB_SUFFIX)
# FFCS - some libraries are skipped because the corresponding tool is deactivated.
@@ -1543,6 +1544,13 @@ bilapP3-hct-like.edp.log: bilapP3-hct-like.edp
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+ClosePoints.edp.log: ClosePoints.edp
+ @p='ClosePoints.edp'; \
+ b='ClosePoints.edp'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
.test.log:
@p='$<'; \
$(am__set_b); \
diff --git a/examples++-load/aniso.cpp b/examples++-load/aniso.cpp
new file mode 100644
index 0000000..1473274
--- /dev/null
+++ b/examples++-load/aniso.cpp
@@ -0,0 +1,137 @@
+// ORIG-DATE: March 2015
+// -*- Mode : c++ -*-
+//
+// SUMMARY : liaison medit freefem++ : adaptmesh in 3d
+// USAGE : LGPL
+// ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE
+// AUTHOR : Jacques Morice
+// E-MAIL : jacques.morice at ann.jussieu.fr
+//
+// for automatic compilation with ff-c++
+//ff-c++-LIBRARY-dep: mshmet libMesh
+//ff-c++-cpp-dep:
+//
+
+/*
+ This file is part of Freefem++
+
+ Freefem++ 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.
+
+ Freefem++ is distributed in the hope that 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 Freefem++; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Thank to the ARN () FF2A3 grant
+ ref:ANR-07-CIS7-002-01
+ */
+//ff-c++-LIBRARY-dep: libMesh
+//compile: ff-c++ -auto aniso.cpp
+#include "ff++.hpp"
+#include "msh3.hpp"
+#include "eigenv.h"
+//#define ADAPTLIBRARY
+/*
+ int eigenv(int symmat,double *mat,double lambda[3],double v[3][3]);
+ int eigen2(double *mm,double *lambda,double vp[2][2]);
+
+ */
+static const int wrapperMetric[6]={0,1,3,2,4,5};
+
+void met3dwrap(double m[6],double mw[6])
+{
+ for(int i=0;i<6;++i)
+ mw[i]=m[wrapperMetric[i]];
+}
+void unmet3dwrap(double mw[6],double m[6])
+{
+ for(int i=0;i<6;++i)
+ m[wrapperMetric[i]]=mw[i];
+}
+
+
+int BoundAniso2d(double m[3],double cmin)
+{
+ double vp[2][2];
+ double l[2];
+ int nv=eigen2(m,l,vp);
+ if(nv)
+ {
+ double vpmx=max(l[0],l[1]);
+ double vpmn = vpmx/cmin;
+ l[0]=max(l[0],vpmn);
+ l[1]=max(l[1],vpmn);
+ m[0] = l[0]*vp[0][0]*vp[0][0] + l[1]*vp[1][0]*vp[1][0];
+ m[1] = l[0]*vp[0][0]*vp[0][1] + l[1]*vp[1][0]*vp[1][1];
+ m[2] = l[0]*vp[0][1]*vp[0][1] + l[1]*vp[1][1]*vp[1][1];
+ }
+ return nv ? 0: 1;
+}
+int BoundAniso3d(double mff[6],double cmin)
+{
+ double m[6];
+ double vp[3][3];
+ double l[3];
+ met3dwrap(mff,m);
+ int nv=eigenv(1,m,l,vp);
+ if(nv)
+ {
+ double vpmx=max(max(l[0],l[1]),l[2]);
+ double vpmn = vpmx/cmin;
+ l[0]=max(l[0],vpmn);
+ l[1]=max(l[1],vpmn);
+ l[2]=max(l[2],vpmn);
+
+ for (int k=0,i=0; i<3; i++)
+ for (int j=i; j<3; j++)
+ m[k++] = l[0]*vp[0][i]*vp[0][j] + l[1]*vp[1][i]*vp[1][j] \
+ + l[2]*vp[2][i]*vp[2][j];
+ }
+ unmet3dwrap(m,mff);
+ return nv ? 0: 1;
+}
+long Boundaniso(long const &k,KN<double> * const &pm,double const &animax)
+{
+ KN<double> & m(*pm);
+ long ns = m.N()/k;
+ ffassert( ns*k== m.N());
+ double lmin = sqrt(animax);
+ ffassert( k==3 || k==6);
+ int err=0;
+ if( k==3)
+ {// <[m11,m12,m22]
+ for(int i=0; i<ns;++i)
+ err+=BoundAniso2d(&m[i*k],animax);
+
+ }
+ else
+ {
+ // 3d [m11,m21,m22,m31,m32,m33
+ for(int i=0; i<ns;++i)
+ err+=BoundAniso3d(&m[i*k],animax);
+
+ }
+ ffassert(err==0);
+ return ns;
+}
+
+static void Load_Init(){ // le constructeur qui ajoute la fonction "splitmesh3" a freefem++
+
+ //if (verbosity)
+ if(verbosity) cout << " load: aniso " << endl;
+
+ Global.Add("boundaniso","(",new OneOperator3_<long,long,KN<double>*,double>(Boundaniso));
+
+}
+
+
+#define WITH_NO_INIT
+#include "msh3.hpp"
+LOADFUNC(Load_Init)
diff --git a/examples++-mpi/PETSc.hpp b/examples++-mpi/PETSc.hpp
index ce3fabc..b41b30b 100755
--- a/examples++-mpi/PETSc.hpp
+++ b/examples++-mpi/PETSc.hpp
@@ -143,6 +143,7 @@ AnyType initCSR_Op<Type>::operator()(Stack stack) const {
KSPSetUp(ptA->_ksp);
if(verbosity > 0 && mpirank == 0)
cout << " --- PETSc preconditioner built (in " << MPI_Wtime() - timing << ")" << endl;
+ MatCreateVecs(ptA->_petsc, &(ptA->_x), nullptr);
return ptA;
}
@@ -270,7 +271,7 @@ class Inv {
void solve(U out) const {
Vec y;
double timing = MPI_Wtime();
- MatCreateVecs((*t)._petsc, &((*t)._x), &y);
+ MatCreateVecs((*t)._petsc, nullptr, &y);
double* x;
VecGetArray((*t)._x, &x);
(*t)._A->template distributedVec<0>((*t)._num, (*t)._first, (*t)._last, static_cast<double*>(*u), x, (*t)._A->getDof());
diff --git a/src/Graphics/getprog-unix.hpp b/src/Graphics/getprog-unix.hpp
index 4c03943..555be1a 100644
--- a/src/Graphics/getprog-unix.hpp
+++ b/src/Graphics/getprog-unix.hpp
@@ -64,7 +64,7 @@ extern void (*init_lgparallele)();
int getprog(char* fn,int argc, char **argv)
{
- waitatend=init_lgparallele==0; // attent if no parallele
+ waitatend= 0; // init_lgparallele==0; // attent if no parallele
consoleatend=false; // bug with redirection FH
int ret=0;
*fn='\0';
diff --git a/src/bamglib/Mesh2.cpp b/src/bamglib/Mesh2.cpp
index c8bf3f2..fa6fc93 100644
--- a/src/bamglib/Mesh2.cpp
+++ b/src/bamglib/Mesh2.cpp
@@ -1460,9 +1460,10 @@ void Triangles::Add( Vertex & s,Triangle * t, Icoor2 * det3)
//--------------------------------------------
Triangle * tt[3]; // the 3 new Triangles
- Vertex &s0 = (* t)[0], &s1=(* t)[1], &s2=(* t)[2];
+ Vertex *ps0 = (* t)(0), *ps1=(* t)(1), *ps2=(* t)(2);
+ Vertex &s0 = *ps0, &s1=*ps1, &s2=*ps2 ;
Icoor2 det3local[3];
- int infv = &s0 ? (( &s1 ? ( &s2 ? -1 : 2) : 1 )) : 0;
+ int infv = t->infv(); //&s0 ? (( &s1 ? ( &s2 ? -1 : 2) : 1 )) : 0;
// infv = ordre of the infini vertex (null)
int nbd0 =0; // number of zero det3
int izerodet=-1,iedge; // izerodet = egde contening the vertex s
@@ -1485,9 +1486,9 @@ void Triangles::Add( Vertex & s,Triangle * t, Icoor2 * det3)
det3[2]=bamg::det(s0,s1,s );}
else {
// one of &s1 &s2 &s0 is NULL so (&si || &sj) <=> !&sk
- det3[0]= &s0 ? -1 : bamg::det(s ,s1,s2) ;
- det3[1]= &s1 ? -1 : bamg::det(s0,s ,s2) ;
- det3[2]= &s2 ? -1 : bamg::det(s0,s1,s ) ;}}
+ det3[0]= ps0 ? -1 : bamg::det(s ,s1,s2) ;
+ det3[1]= ps1 ? -1 : bamg::det(s0,s ,s2) ;
+ det3[2]= ps2 ? -1 : bamg::det(s0,s1,s ) ;}}
if (!det3[0]) izerodet=0,nbd0++;
diff --git a/src/bamglib/Mesh2.h b/src/bamglib/Mesh2.h
index c842357..c995da2 100644
--- a/src/bamglib/Mesh2.h
+++ b/src/bamglib/Mesh2.h
@@ -401,7 +401,7 @@ class Triangle {
inline void Set(const Triangle &,const Triangles &,Triangles &);
inline int In(Vertex *v) const { return ns[0]==v || ns[1]==v || ns[2]==v ;}
TriangleAdjacent FindBoundaryEdge(int ) const;
-
+ int infv() const {return ns[0] ? (( ns[1] ? ( ns[2] ? -1 : 2) : 1 )) : 0;}
void ReNumbering(Triangle *tb,Triangle *te, Int4 *renu)
{
if (link >=tb && link <te) link = tb + renu[link -tb];
@@ -637,8 +637,8 @@ class VertexOnGeom { public:
GeometricalEdge * ge; // if abscisse in [0..1]
};
inline void Set(const VertexOnGeom&,const Triangles &,Triangles &);
- int OnGeomVertex()const {return this? abscisse <0 :0;}
- int OnGeomEdge() const {return this? abscisse >=0 :0;}
+ int OnGeomVertex()const {return abscisse <0 ;}
+ int OnGeomEdge() const {return abscisse >=0 ;}
VertexOnGeom(): mv(0),abscisse(0){gv=0;}
VertexOnGeom(Vertex & m,GeometricalVertex &g) : mv(&m),abscisse(-1){gv=&g;}
// cout << " mv = " <<mv << " gv = " << gv << endl;}
diff --git a/src/bin-win32/launchff++.cpp b/src/bin-win32/launchff++.cpp
index 79ef300..80cb3a0 100755
--- a/src/bin-win32/launchff++.cpp
+++ b/src/bin-win32/launchff++.cpp
@@ -14,12 +14,14 @@ int main(int argc,const char **argv)
int debug=0;
char *dir=0;
const char *pp=0;
- string cmd="freefem++.exe ";
+ string cmd="freefem++.exe";
if(argc <=1)
{
- cerr << " Sorry no file name "<< endl;
- cerr << " Drag and Drop the file icon on the application icon or double clip on script file" << endl;
- exit(1);
+ // cerr << " Sorry no file name "<< endl;
+ // cerr << " Drag and Drop the file icon on the application icon or double clip on script file" << endl;
+ cmd += " -wait -log";
+ int ret= system(cmd.c_str());
+ return 0;
}
for(int i=1;i<argc;++i)
diff --git a/src/femlib/MatriceCreuse.hpp b/src/femlib/MatriceCreuse.hpp
index 1562079..6b0eeed 100644
--- a/src/femlib/MatriceCreuse.hpp
+++ b/src/femlib/MatriceCreuse.hpp
@@ -697,7 +697,7 @@ int ConjuguedGradient(const M & A,const P & C,const KN_<R> &b,KN_<R> &x,const in
if (verbosity>50)
kprint=2;
if (verbosity>99) cout << A << endl;
- throwassert(&x && &b && &A && &C);
+// throwassert(&x && &b && &A && &C);
typedef KN<R> Rn;
int n=b.N();
throwassert(n==x.N());
diff --git a/src/femlib/RefCounter.hpp b/src/femlib/RefCounter.hpp
index 957e0cd..3cb3eeb 100644
--- a/src/femlib/RefCounter.hpp
+++ b/src/femlib/RefCounter.hpp
@@ -48,14 +48,14 @@ class baseCountPointer { protected:
};
class RefCounter {
-
+ static RefCounter *tnull;
mutable int count;
protected:
virtual ~RefCounter() {}
RefCounter() : count(0) {}
public:
int destroy() const {
- if(this) {throwassert(count>=0);
+ if(this!=tnull) {throwassert(count>=0);
if ( count--==0) {
SHOWVERB( cout << "True destruction of " << this << endl);
delete this;
diff --git a/src/fflib/AFunction.hpp b/src/fflib/AFunction.hpp
index 07becb4..0d27cee 100644
--- a/src/fflib/AFunction.hpp
+++ b/src/fflib/AFunction.hpp
@@ -241,6 +241,7 @@ class basicForEachType : public CodeAlloc {
const type_info * ktype; // the real type_info
// const type_info *ktypefunc;// the type of code
public:
+ static basicForEachType * tnull;
const size_t size;
@@ -254,7 +255,7 @@ class basicForEachType : public CodeAlloc {
friend ostream & operator<<(ostream & f,const basicForEachType & e)
{ f << '<' << e.name() << '>' ;return f;}
void Show(ostream & f) const ;
- const char * name() const { return this ? ktype->name() :"NULL" ;}
+ const char * name() const { return this!=tnull ? ktype->name() :"NULL" ;}
virtual bool CastingFrom(const basicForEachType * t) const ;
// modif FH ----- A TESTER //
virtual bool SametypeRight(const basicForEachType * t) const {return (this == t) || (t == un_ptr_type) || (t == type_C_F0);}
@@ -349,7 +350,7 @@ class C_LF1;
class E_F0 :public CodeAlloc
{
public:
-
+ static E_F0 *tnull;
struct kless : binary_function<Expression,Expression, bool>
{ bool operator()(const Expression& x, const Expression& y) const{
//cout << x << " " << y << x->compare(y) << " ::: ";
@@ -359,7 +360,7 @@ class E_F0 :public CodeAlloc
typedef map< E_F0 *,int,kless> MapOfE_F0;
virtual AnyType operator()(Stack) const =0;
- virtual bool Empty() const {return !this; }
+ virtual bool Empty() const {return this==tnull; }
// virtual E_F0 * destroy(Stack ) const {return 0;}
// virtual const E_F0 * Parameter(Stack ) const {return this;}
virtual size_t nbitem() const {return 1;}
@@ -388,7 +389,7 @@ class E_F0 :public CodeAlloc
};
-inline ostream & operator<<(ostream & f,const E_F0 &e) { if(&e) e.dump(f); else f << " --0-- " ;return f;}
+inline ostream & operator<<(ostream & f,const E_F0 &e) { if(!e.Empty()) e.dump(f); else f << " --0-- " ;return f;}
/// <<E_F0mps>> Specialization of [[E_F0]] where MeshIndependent() always returns false instead of true.
@@ -2955,7 +2956,7 @@ class OneOpCast: public OneOperator {
//
inline bool basicForEachType::CastingFrom(aType t) const {
- throwassert(this && t);
+ throwassert( t);
if ( t == this) return true;
else if( t == type_C_F0 ) return true; // FH do work .... 09 / 2012 (use of ellispe ...)
return casting->FindSameR(ArrayOfaType(t,false));
@@ -3204,7 +3205,7 @@ inline int E_F0::find(const MapOfE_F0 & m) { // exp
return rr;
}
-extern queue<pair<const E_Routine*,int> > * debugstack;
+extern vector<pair<const E_Routine*,int> > * debugstack;
struct NothingType { // a type to do nothing
NothingType() {};
diff --git a/src/fflib/AFunction2.cpp b/src/fflib/AFunction2.cpp
index 5aebc32..5ffd6ac 100644
--- a/src/fflib/AFunction2.cpp
+++ b/src/fflib/AFunction2.cpp
@@ -44,7 +44,7 @@
#include "rgraph.hpp"
#include "InitFunct.hpp"
-queue<pair<const E_Routine*,int> > *debugstack=0;
+vector<pair<const E_Routine*,int> > *debugstack=0;
class vectorOfInst : public E_F0mps { public:
@@ -112,7 +112,7 @@ OneOperator::pair_find OneOperator::FindWithOutCast(const ArrayOfaType & at)cons
OneOperator* OneOperator::FindSameR(const ArrayOfaType & at)
{
- if (!this) return 0;
+ if (this==tnull) return 0;
OneOperator *oo,*r;
int n=0;
for (oo=this;oo;oo=oo->next)
@@ -607,7 +607,7 @@ void basicForEachType::AddCast(CastFunc f1,CastFunc f2,CastFunc f3,CastFunc f4,
ostream & operator<<(ostream & f,const Polymorphic & a)
{
Polymorphic::const_iterator i;
- if(!&a) return f << "Null " << endl;
+ if(&a==E_F0::tnull) return f << "Null " << endl;
for (i=a.m.begin();i!=a.m.end();i++)
{
f << " operator" << i->first << " : " << endl;
@@ -712,7 +712,8 @@ struct CleanE_Routine {
};
AnyType E_Routine::operator()(Stack s) const {
- debugstack->push(pair<const E_Routine*,int>(this,TheCurrentLine));
+ //cout << " E_Routine:: push " <<debugstack <<" " << TheCurrentLine << " " <<debugstack->size() << endl;
+ debugstack->push_back(pair<const E_Routine*,int>(this,TheCurrentLine));
const int lgsave=BeginOffset*sizeof(void*);
char save[lgsave];
AnyType ret=Nothing;
@@ -744,17 +745,21 @@ AnyType E_Routine::operator()(Stack s) const {
(*clean)(s);
WhereStackOfPtr2Free(s)->clean(); // FH mars 2005
memcpy(s,save,lgsave); // restore
- TheCurrentLine=debugstack->front().second;
- debugstack->pop();
- throw ;
+ TheCurrentLine=debugstack->back().second;
+ debugstack->pop_back();
+ // cout << " E_Routine:: ... pop " <<debugstack <<" " << TheCurrentLine << " " <<debugstack->size() << endl;
+
+ throw ;
}
(*clean)(s); // the clean is done in CleanE_Routine delete .
// delete [] listparam; after return
memcpy(s,save,lgsave); // restore
- TheCurrentLine=debugstack->front().second;
- debugstack->pop();
- // il faudrait que les variable locale soit detruire apres le return
+ TheCurrentLine=debugstack->back().second;
+ debugstack->pop_back();
+ // cout << " E_Routine:: pop " <<debugstack <<" " << TheCurrentLine << " " <<debugstack->size() << endl;
+
+ // il faudrait que les variable locale soit detruire apres le return
// cf routine clean, pour le cas ou l'on retourne un tableau local.
// plus safe ????? FH. (fait 2008)
// mais pb si a = f()+g() OK les pointeurs des instruction sont detruit
@@ -860,12 +865,11 @@ void ShowDebugStack()
else
cerr << " current line = " << TheCurrentLine << endl;
if(debugstack)
- while ( debugstack->size() )
+ for (int i=0; i<debugstack->size(); ++i)
{
- cerr << " call " << debugstack->front().first->name<< " at line "
- <<debugstack->front().second << endl;
- debugstack->pop();
+ cerr << " call " << debugstack->at(i).first->name<< " at line "
+ <<debugstack->at(i).second << endl;
}
}
diff --git a/src/fflib/AFunction_ext.hpp b/src/fflib/AFunction_ext.hpp
index 00c7ece..d289a2a 100644
--- a/src/fflib/AFunction_ext.hpp
+++ b/src/fflib/AFunction_ext.hpp
@@ -72,15 +72,15 @@ class E_F_F0F0F0s_ :public E { public: // extend
AnyType operator()(Stack s) const
{return SetAny<R>( f( s,
GetAny<A0>((*a0)(s)),
- GetAny<A0>((*a1)(s)),
- GetAny<A1>((*a2)(s)) ) );} // extend (3th arg.)
+ GetAny<A1>((*a1)(s)),
+ GetAny<A2>((*a2)(s)) ) );} // extend (3th arg.)
virtual size_t nbitem() const {return a2->nbitem(); } // modif ???
bool MeshIndependent() const
{return a0->MeshIndependent() && a1->MeshIndependent() && a2->MeshIndependent() ;} // extend (2th arg.)
};
-template<class R,class A=R,class B=A,class C=B, class D=C ,class CODE=E_F_F0F0F0s_<R,A,B,C,E_F0> > // extend (3th arg.)
+template<class R,class A=R,class B=A,class C=B, class CODE=E_F_F0F0F0s_<R,A,B,C,E_F0> > // extend (3th arg.)
class OneOperator3s_ : public OneOperator { //
aType r; // return type
typedef typename CODE::func func;
@@ -93,8 +93,8 @@ public:
return new CODE(f,
t[0]->CastTo(args[0]),
- t[0]->CastTo(args[1]),
- t[1]->CastTo(args[2]));} // extend
+ t[1]->CastTo(args[1]),
+ t[2]->CastTo(args[2]));} // extend
OneOperator3s_(func ff): // 2->
OneOperator(map_type[typeid(R).name()],
map_type[typeid(A).name()],
diff --git a/src/fflib/CodeAlloc.hpp b/src/fflib/CodeAlloc.hpp
index 7467916..93e91a0 100644
--- a/src/fflib/CodeAlloc.hpp
+++ b/src/fflib/CodeAlloc.hpp
@@ -34,7 +34,9 @@ class CodeAlloc { public:
static void * lgmax;
static bool sort;
static size_t memoryusage; // add FH mach 2014 ..
+ static CodeAlloc * tnull;
static bool isdel(int i)
+
{
return ((char *) (void *) mem[i] - (char *) 0) % 2 == 1;
}
diff --git a/src/fflib/ffstack.hpp b/src/fflib/ffstack.hpp
index 7894111..dd4a448 100644
--- a/src/fflib/ffstack.hpp
+++ b/src/fflib/ffstack.hpp
@@ -206,10 +206,12 @@ public:
}
bool clean()
- { bool ret= !stackptr.empty();
+ {
+ topmemory4tmp=0;// clean the tmp allocation
+ bool ret= !stackptr.empty();
if(ret)
{
- topmemory4tmp=0;// clean the tmp allocation
+
if(stackptr.size()>=20 && verbosity>2)
// FFCS: nothing on following line for tests/compare
cout << "\n\t\t ### big?? ptr/lg clean " << stackptr.size() << " ptr's\n";
@@ -229,7 +231,9 @@ public:
{
int lg8=lg%8;
if(lg8) lg += 8-lg8;
- if(topmemory4tmp + lg>= sizeofmemory4tmp) {ffassert(0);}
+ if(topmemory4tmp + lg>= sizeofmemory4tmp) {
+ ErrorExec(" Fatal Error: too much temporary alloction, your expression is too long, or a bug in ff++, FH; april,2015",1);
+ ffassert(0);}
void * p=static_cast<void*> (memory4tmp+topmemory4tmp);// correct FH Oct 2009
topmemory4tmp+= lg;
return p;
diff --git a/src/fflib/global.cpp b/src/fflib/global.cpp
index 843612c..10ec4a2 100644
--- a/src/fflib/global.cpp
+++ b/src/fflib/global.cpp
@@ -30,6 +30,7 @@
#include <iostream>
#include <cstdio>
+
namespace ffapi {
// void init) ();
@@ -170,5 +171,10 @@ bool echo_edp=true; // add F.H of remove script dump
// add F. Hecht
EnvironmentData ffenvironment;
+basicForEachType *basicForEachType::tnull=0;
+E_F0 *E_F0::tnull=0;
+CodeAlloc *CodeAlloc::tnull=0;
+#include <RefCounter.hpp>
+RefCounter *RefCounter::tnull=0;
diff --git a/src/fflib/problem.cpp b/src/fflib/problem.cpp
index 5585e7d..0105c9b 100644
--- a/src/fflib/problem.cpp
+++ b/src/fflib/problem.cpp
@@ -414,7 +414,7 @@ void Check(const Opera &Op,int N,int M)
all=false;
}*/
if (verbosity>3) cout <<" Optimized = "<< useopt << ", ";
- const E_F0 & optiexp0=*b->b->optiexp0;
+ const E_F0 * poptiexp0=b->b->optiexp0;
int n_where_in_stack_opt=b->b->where_in_stack_opt.size();
R** where_in_stack =0;
@@ -432,8 +432,8 @@ void Check(const Opera &Op,int N,int M)
}
- if(&optiexp0)
- optiexp0(stack);
+ if(poptiexp0)
+ (*poptiexp0)(stack);
KN<bool> ok(b->b->v.size());
{ // remove the zero coef in the liste
// R zero=R();
@@ -706,7 +706,7 @@ void Check(const Opera &Op,int N,int M)
all=false;
}*/
if (verbosity>3) cout <<" Optimized = "<< useopt << ", ";
- const E_F0 & optiexp0=*b->b->optiexp0;
+ const E_F0 * poptiexp0=b->b->optiexp0;
int n_where_in_stack_opt=b->b->where_in_stack_opt.size();
R** where_in_stack =0;
@@ -724,8 +724,8 @@ void Check(const Opera &Op,int N,int M)
}
- if(&optiexp0)
- optiexp0(stack);
+ if(poptiexp0)
+ (*poptiexp0)(stack);
KN<bool> ok(b->b->v.size());
{ // remove the zero coef in the liste
// R zero=R();
@@ -1467,7 +1467,7 @@ void Check(const Opera &Op,int N,int M)
all=false;
}*/
if (verbosity>3) cout <<" Optimized = "<< useopt << ", ";
- const E_F0 & optiexp0=*b->b->optiexp0;
+ const E_F0 * poptiexp0=b->b->optiexp0;
// const E_F0 & optiexpK=*b->b->optiexpK;
int n_where_in_stack_opt=b->b->where_in_stack_opt.size();
R** where_in_stack =0;
@@ -1485,8 +1485,8 @@ void Check(const Opera &Op,int N,int M)
}
- if(&optiexp0)
- optiexp0(stack);
+ if(poptiexp0)
+ (*poptiexp0)(stack);
KN<bool> ok(b->b->v.size());
{ // remove the zero coef in the liste
// R zero=R();
@@ -1727,7 +1727,7 @@ void Check(const Opera &Op,int N,int M)
all=false;
}*/
if (verbosity>3) cout <<" Optimized = "<< useopt << ", ";
- const E_F0 & optiexp0=*b->b->optiexp0;
+ const E_F0 *poptiexp0=b->b->optiexp0;
// const E_F0 & optiexpK=*b->b->optiexpK;
int n_where_in_stack_opt=b->b->where_in_stack_opt.size();
R** where_in_stack =0;
@@ -1745,8 +1745,8 @@ void Check(const Opera &Op,int N,int M)
}
- if(&optiexp0)
- optiexp0(stack);
+ if(poptiexp0)
+ (*poptiexp0)(stack);
KN<bool> ok(b->b->v.size());
{ // remove the zero coef in the liste
// R zero=R();
@@ -3604,11 +3604,15 @@ void Check(const Opera &Op,int N,int M)
void Element_rhsVF(const FElement & Kv,const FElement & KKv,int ie,int iie,int label,const LOperaD &Op,double * p,int *ip,void * bstack,KN_<R> & B,
const QuadratureFormular1d & FI = QF_GaussLegendre2)
// sier of ip
+ // version correct the 29 april 2015 by. FH
+ // missing before in case of jump, mean , .. in test functions
+ // Thank to Lucas Franceschini <lucas.franceschini at ensta-paristech.fr>
{
pair_stack_double * bs=static_cast<pair_stack_double *>(bstack);
Stack stack= bs->first;
double binside = *bs->second; // truc FH pour fluide de grad2 (decentrage bizard)
-
+ bool onborder= &Kv.T == &KKv.T;
+ const FElement *pKKv= !onborder ? & KKv : 0;
MeshPoint mp=*MeshPointStack(stack) ;
R ** copt = Stack_Ptr<R*>(stack,ElemMatPtrOffset);
const Triangle & T = Kv.T;
@@ -3634,7 +3638,7 @@ void Check(const Opera &Op,int N,int M)
int lffv = nv*N*last_operatortype;
int lp =nv*2;
KN_<int> pp(ip,lp),pk(ip+lp,lp),pkk(ip+2*lp,lp);
- int n = BuildMEK_KK(lp,pp,pk,pkk,&Kv,&KKv);
+ int n = BuildMEK_KK(lp,pp,pk,pkk,&Kv,pKKv);
RNMK_ fu(p,nv,N,lastop); // the value for basic fonction
RNMK_ ffu( (double*) p + lffv ,nv,N,lastop); // the value for basic fonction
@@ -3648,7 +3652,6 @@ void Check(const Opera &Op,int N,int M)
PP_B(TriangleHat[VerticesOfTriangularEdge[iie][0]]),
PP_C(TriangleHat[OppositeVertex[ie]]);
R2 Normal(E.perp()/-le);
- bool onborder= &Kv.T == &KKv.T;
double cmean = onborder ? 1. : 0.5;
for (npi=0;npi<FI.n;npi++) // loop on the integration point
{
@@ -3677,10 +3680,14 @@ void Check(const Opera &Op,int N,int M)
// if (alledges || onWhatIsEdge[ie][Kv.DFOnWhat(i)]) // bofbof faux si il y a des derives ..
{
int ik= pk[i];
- int ikk=pkk[i];
+ int ikk=pkk[i];
+
RNM_ wi(fu(Max(ik,0),'.','.'));
RNM_ wwi(ffu(Max(ikk,0),'.','.'));
int il=0;
+ int dofik=ik>=0? Kv(ik):-1;
+ int dofikk=ikk>=0? KKv(ikk):-1;
+
for (LOperaD::const_iterator l=Op.v.begin();l!=Op.v.end();l++,il++)
{
@@ -3695,9 +3702,10 @@ void Check(const Opera &Op,int N,int M)
if( iicase>0 )
{
if( ikk>=0) ww_i = wwi(ii.first,iis );
- if (iicase==Code_Jump) w_i = ww_i-w_i; // jump
- else if (iicase==Code_Mean) w_i = cmean* (w_i + ww_i ); // average
- else if (iicase==Code_OtherSide) w_i = ww_i; // valeur de autre cote
+ if (iicase==Code_Jump) w_i = -w_i; ///(w_i = ww_i-w_i); // jump
+ else if (iicase==Code_Mean) ww_i=w_i = cmean* (w_i + ww_i ); // average
+ else if (iicase==Code_OtherSide) std::swap(w_i,ww_i); // valeur de autre cote
+ else ffassert(0);
}
R c =copt ? *(copt[il]) : GetAny<R>(ll.second.eval(stack));
// FFCS - removing what is probably a small glitch
@@ -3713,7 +3721,9 @@ void Check(const Opera &Op,int N,int M)
//= GetAny<double>(ll.second.eval(stack));
- B[Kv(i)] += coef * c * w_i;
+ if(dofik>=0) B[dofik] += coef * c * w_i;
+ if(dofikk>=0) B[dofikk] += coef * c * ww_i;
+
}
}
@@ -4385,7 +4395,7 @@ template<class R>
if (verbosity>3) cout << " Optimized = "<< useopt << ", ";
- const E_F0 & optiexp0=*l->l->optiexp0;
+ const E_F0 * poptiexp0=l->l->optiexp0;
// const E_F0 & optiexpK=*l->l->optiexpK;
int n_where_in_stack_opt=l->l->where_in_stack_opt.size();
R** where_in_stack = 0;
@@ -4401,7 +4411,7 @@ template<class R>
where_in_stack[i]= static_cast<R *>(static_cast<void *>((char*)stack+offset));
*(where_in_stack[i])=0;
}
- if(&optiexp0) optiexp0(stack);
+ if(poptiexp0) (*poptiexp0)(stack);
if( (verbosity/100) && verbosity % 10 == 2)
{
@@ -4704,7 +4714,7 @@ template<class R>
} */
if (verbosity>3) cout << " Optimized = "<< useopt << ", ";
- const E_F0 & optiexp0=*l->l->optiexp0;
+ const E_F0 * poptiexp0=l->l->optiexp0;
// const E_F0 & optiexpK=*l->l->optiexpK;
int n_where_in_stack_opt=l->l->where_in_stack_opt.size();
R** where_in_stack =0;
@@ -4720,7 +4730,7 @@ template<class R>
where_in_stack[i]= static_cast<R *>(static_cast<void *>((char*)stack+offset));
*(where_in_stack[i])=0;
}
- if(&optiexp0) optiexp0(stack);
+ if(poptiexp0) (*poptiexp0)(stack);
if( (verbosity/100) && verbosity % 10 == 2)
{
@@ -5015,9 +5025,9 @@ void InitProblem( int Nb, const FESpace & Uh,
if (!X || (X =B) )
X=new KN<R>(B->N());
const FEbase<R,v_fes> & u_h0 = *(u_h[0]);
- const FESpace * u_Vh = &*u_h0.Vh ;
+ const FESpace * u_Vh = u_h0.Vh ;
- if ( u_Vh==0 || &(*(u_h[0])).Vh->Th != &Th )
+ if ( u_Vh==0 || &((u_h[0])->Vh->Th) != &Th )
{
*X=R();
if(verbosity>1)
diff --git a/src/fflib/strversionnumber.cpp b/src/fflib/strversionnumber.cpp
index 1607c59..0b17094 100644
--- a/src/fflib/strversionnumber.cpp
+++ b/src/fflib/strversionnumber.cpp
@@ -18,6 +18,6 @@ string StrVersionNumber(){
// buffer.precision(8);
// buffer<<VersionNumber();
static char buffer[100];
- sprintf(buffer," %9f (date Jeu 9 avr 2015 13:03:31 CEST)",VersionNumber());
- return buffer; //.str()+" (date Jeu 9 avr 2015 13:03:31 CEST)" ;
+ sprintf(buffer," %9f (date Jeu 30 avr 2015 17:54:04 CEST)",VersionNumber());
+ return buffer; //.str()+" (date Jeu 30 avr 2015 17:54:04 CEST)" ;
}
diff --git a/src/lglib/lg.tab.cpp b/src/lglib/lg.tab.cpp
index 6e97a84..0839ff2 100644
--- a/src/lglib/lg.tab.cpp
+++ b/src/lglib/lg.tab.cpp
@@ -2091,7 +2091,7 @@ yyreduce:
if(verbosity>2 || mpirank==0) cout << " sizestack + 1024 =" << sizestack << " ( " << sizestack-1024 <<" )\n" ;
size_t lg0,lg1;
int NbPtr = ShowAlloc("init execution ",lg0); // number of un delele ptr
- debugstack= new queue<pair<const E_Routine*,int> >;
+ debugstack= new vector<pair<const E_Routine*,int> >;
size_t stu0=storageused(); // get Storage usage
UnShowAlloc =0;// add FH for parallee
if(verbosity>2 || mpirank==0) cout << endl;
diff --git a/src/lglib/lg.ypp b/src/lglib/lg.ypp
index 96486c8..1db7532 100644
--- a/src/lglib/lg.ypp
+++ b/src/lglib/lg.ypp
@@ -296,7 +296,7 @@ start: input ENDOFFILE {
if(verbosity>2 || mpirank==0) cout << " sizestack + 1024 =" << sizestack << " ( " << sizestack-1024 <<" )\n" ;
size_t lg0,lg1;
int NbPtr = ShowAlloc("init execution ",lg0); // number of un delele ptr
- debugstack= new queue<pair<const E_Routine*,int> >;
+ debugstack= new vector<pair<const E_Routine*,int> >;
size_t stu0=storageused(); // get Storage usage
UnShowAlloc =0;// add FH for parallee
if(verbosity>2 || mpirank==0) cout << endl;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/freefempp.git
More information about the debian-science-commits
mailing list